package stark.app.function.calculator;

import android.content.Intent;

import com.stark.calculator.CalculatorEntry;
import com.stark.calculator.ci.CiCalActivity;
import com.stark.calculator.mortgage.constant.MortShowMode;
import com.stark.calculator.tax.constant.TaxShowMode;
import com.stark.calculator.unit.constant.ConvertType;

import stark.app.R;
import stark.app.databinding.ActivityCalculatorDemoBinding;
import stark.common.basic.base.BaseNoModelActivity;
import stark.common.basic.constant.ThemeMode;

/**
 * Author：daizhongbin on 2021/4/15
 * Email：1027154338@qq.com
 * Desc:
 */
public class CalculatorDemoActivity extends BaseNoModelActivity<ActivityCalculatorDemoBinding> {
    @Override
    protected int onCreate() {
        return R.layout.activity_calculator_demo;
    }

    @Override
    protected void initView() {
        mDataBinding.btnScienceCal.setOnClickListener(v -> {
            startActivity(ScienceCalActivity.class);
        });
        mDataBinding.btnGeneralCalLight.setOnClickListener(v -> {
            CalculatorEntry.enterGeneralCalculator(this);
        });
        mDataBinding.btnGeneralCalNight.setOnClickListener(v -> {
            CalculatorEntry.enterGeneralCalculator(this, ThemeMode.NIGHT);
        });
        mDataBinding.btnGeneralCalCustom.setOnClickListener(v -> {
            Intent intent = new Intent(this, CustomCalActivity.class);
            startActivity(intent);
        });

        //房贷计算器相关
        mDataBinding.btnMort.setOnClickListener(v -> {
            CalculatorEntry.enterMort(this);
        });
        mDataBinding.btnMortCommercial.setOnClickListener(v -> {
            CalculatorEntry.enterMort(this, MortShowMode.COMMERCIAL_ONLY);
        });
        mDataBinding.btnMortFund.setOnClickListener(v -> {
            CalculatorEntry.enterMort(this, MortShowMode.FUND_ONLY);
        });
        mDataBinding.btnMortGroup.setOnClickListener(v -> {
            CalculatorEntry.enterMort(this, MortShowMode.GROUP_ONLY);
        });

        //个税计算器相关
        mDataBinding.btnTaxAll.setOnClickListener(v -> {
            CalculatorEntry.enterTax(this);
        });
        mDataBinding.btnTaxSalary.setOnClickListener(v -> {
            CalculatorEntry.enterTax(this, TaxShowMode.SALARY_ONLY);
        });
        mDataBinding.btnTaxNzj.setOnClickListener(v -> {
            CalculatorEntry.enterTax(this, TaxShowMode.YEAR_END_AWARD_ONLY);
        });
        mDataBinding.btnTaxRemuneration.setOnClickListener(v -> {
            CalculatorEntry.enterTax(this, TaxShowMode.REMUNERATION_ONLY);
        });

        //单位转换相关
        mDataBinding.btnLenConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.LENGTH);
        });
        mDataBinding.btnAreaConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.AREA);
        });
        mDataBinding.btnVolumeConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.VOLUME);
        });
        mDataBinding.btnWeightConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.WEIGHT);
        });
        mDataBinding.btnTempConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.TEMPERATURE);
        });
        mDataBinding.btnSpeedConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.SPEED);
        });
        mDataBinding.btnTimeConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.TIME);
        });
        mDataBinding.btnPowerConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.POWER);
        });
        mDataBinding.btnCaloryConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.CALORIES);
        });
        mDataBinding.btnForceConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.FORCE);
        });
        mDataBinding.btnAngelConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.ANGEL);
        });
        mDataBinding.btnByteConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.BYTE);
        });
        mDataBinding.btnDensityConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.DENSITY);
        });
        mDataBinding.btnPressureConvert.setOnClickListener(v -> {
            CalculatorEntry.enterUnitConvert(this, ConvertType.PRESSURE);
        });
        mDataBinding.btnEnterCiCal.setOnClickListener(v -> {
            startActivity(CiCalActivity.class);
        });

    }

    @Override
    protected void initData() {

    }
}
